package com.gong.gongcloudpicture1.model.enums;

import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;


/**
 * 管理员审核状态
 */
@Getter
public enum PictureReviewStatusEnum {

    APPROVAL("待审核", 0),
    PASS("通过", 1),
    REFUSE("拒绝", 2)
    ;


    private final String name;
    private final int value;

    private PictureReviewStatusEnum(final String name, final int value) {
        this.name = name;
        this.value = value;
    }



    public static PictureReviewStatusEnum getNameByValue(Integer value) {
        if (value == null) {
            return null;
        }
        Map<Integer, PictureReviewStatusEnum> collect = Arrays.stream(PictureReviewStatusEnum.values()).collect(Collectors.toMap(PictureReviewStatusEnum::getValue, v -> v));
        return collect.get(value);
    }



}
